package L1;

import java.util.Scanner;

public class _008 {

	public static void main(String[] args) {
		Scanner reader=new Scanner(System.in);
		int first=reader.nextInt();
		int last=reader.nextInt();
		int k=1,sum=0;
		for(int i=first;i<last;i++)
		{
			sum+=i;
			if(k%5==0)
			{
				System.out.printf("%5d",i);
				//System.out.println("     "+i);
				System.out.println();
				k++;
			}
			else
			{
				System.out.printf("%5d",i);
				//System.out.print("     "+i);
				k++;
			}
		}
		//System.out.println("     "+last);
		System.out.printf("%5d",last);
		System.out.println();
		System.out.println("Sum = "+(sum+last));
		reader.close();
	}

}
